package servlet.sendemailservlet;

import commons.EmailUtil;
import commons.baseServlet.BaseServlet;
import commons.r.R;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;

/**
 * servlet
 * User: 邱
 * Date: 2024/12/21 18:49
 * Description:
 * Version: V1.0
 */
@WebServlet("/sendEmail/*")
public class sendEmailServlet extends BaseServlet {
    public R sendAlarmEmail(HttpServletRequest request){
        try {
            EmailUtil.sendAuthCodeEmail("1603139698@qq.com","紧急报警","成都市武侯区天府2街桂溪路XXXX号--智慧社区出现紧急事件，速来！！！");
            return R.ok("发送成功");
        }catch (Exception e){
            e.printStackTrace();
            return R.ok("发送失败");
        }
    }
}
